﻿using System;

namespace Eneta.Portal.Common.Dto
{
    /// <summary>
    /// Class for blog entries.
    /// </summary>
    public class BlogEntryDto : NewsItemDto
    {
        /// <summary>
        /// Gets or sets the ID of blog entry.
        /// </summary>
        /// <value>The ID.</value>
        public int ID
        {
            get
            {
                return Id;
            }
            set
            {
                Id = value;
            }
        }

        /// <summary>
        /// Gets or sets the body of blog entry.
        /// </summary>
        public override string Body
        {
            get
            {
                return Summary;
            }
            set
            {
                Summary = value;
            }
        }

        /// <summary>
        /// Gets or sets the summary of blog entry.
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// Gets or sets the date when blog entry was published.
        /// </summary>
        public DateTime Date { get; set; }

        public override string DisplayUrl
        {
            get
            {
                return "/uudised/blogid/Lehed/" + FileName;
            }
        }
        
        /// <summary>
        /// Gets or sets the URL of blog entry.
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="BlogEntryDto"/> is accepted.
        /// </summary>
        /// <value><c>true</c> if accepted; otherwise, <c>false</c>.</value>
        public bool Accepted { get; set; }

        /// <summary>
        /// Gets or sets the author of blog entry.
        /// </summary>
        public string Author { get; set; }

        /// <summary>
        /// Gets or sets the ID of auhtor.
        /// </summary>
        public int AuhtorId { get; set; }

        /// <summary>
        /// Gets or sets the profile id of blog entry author.
        /// </summary>
        public int ProfileId { get; set; }

        /// <summary>
        /// Gets or sets the blog id. This is the parent blog of blog entry.
        /// </summary>
        public int BlogId { get; set; }

        /// <summary>
        /// Gets or sets the name of the blog.
        /// </summary>
        public string BlogName { get; set; }

        public string BlogUrl { get; set; }

        /// <summary>
        /// Gets or sets the RSS URL of blog. This RSS URL is used by aggregator.
        /// </summary>
        public string RssUrl { get; set; }

        /// <summary>
        /// Gets or sets the status comment inserted by administrator when blog entry 
        /// is accepted or denied.
        /// </summary>
        public string StatusComment { get; set; }

        public override DateTime PublishDate
        {
            get
            {
                return Date;
            }
            set
            {
                ;
            }
        }

        public override string OwnerProfileName
        {
            get
            {
                return Author;
            }
            set
            {
                Author = value;
            }
        }

        public override string InfoSourceName
        {
            get
            {
                return BlogName;
            }
            internal set
            {
                ;
            }
        }

        public override string InfoSourceUrl
        {
            get
            {
                return "/uudised/blogid/Lehed/" + FileName;
            }
            internal set
            {
                ;
            }
        }
    }
}
